<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilsecure: xsecure_lms_ots.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilsecure
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xsecure__lms__ots_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xsecure_lms_ots.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file consists definitions for LMS OTS operations. </p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date        Changes
----- ---- -------- ----------------------------------------------------------
5.4   kal  07/24/24  Initial release</pre><pre></pre><dl class="section note"><dt>Note</dt><dd></dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a962337132813f098ed3a128cb4167b27"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsecure__lms__ots_8c.html#a962337132813f098ed3a128cb4167b27">XSecure_LmsOtsCoeff</a> (u8 const *const Arr, const u32 ArrayIndex, const u32 w)</td></tr>
<tr class="memdesc:a962337132813f098ed3a128cb4167b27"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function extracts the digits from the array for bytes.  <a href="#a962337132813f098ed3a128cb4167b27">More...</a><br/></td></tr>
<tr class="separator:a962337132813f098ed3a128cb4167b27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4b1b7bba0abda9f7e5f7431cf2e07ce"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsecure__lms__ots_8c.html#ae4b1b7bba0abda9f7e5f7431cf2e07ce">XSecure_LmsOtsComputeChecksum</a> (const u8 *const Array, const u32 ArrayLen, const u32 w, const u32 ls, u32 *const <a class="el" href="xsecure__lms__ots_8h.html#a97ec2bf3dbf9fab80e5046d5c3394633">Checksum</a>)</td></tr>
<tr class="memdesc:ae4b1b7bba0abda9f7e5f7431cf2e07ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function calculates the checksum for a given array.  <a href="#ae4b1b7bba0abda9f7e5f7431cf2e07ce">More...</a><br/></td></tr>
<tr class="separator:ae4b1b7bba0abda9f7e5f7431cf2e07ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48db68f8b63048019c35a756e58d9181"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsecure__lms__ots_8c.html#a48db68f8b63048019c35a756e58d9181">XSecure_LmsOtsLookupParamSet</a> (<a class="el" href="xsecure__lms__ots_8h.html#ac44fed4428b1bce22f588c3c913818fd">XSecure_LmsOtsType</a> <a class="el" href="xsecure__lms__ots_8h.html#a8edafe9629f0c895a14f0e7445bcbd5c">Type</a>, XSecure_LmsOtsParam **Parameters)</td></tr>
<tr class="memdesc:a48db68f8b63048019c35a756e58d9181"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the parameters for the type of LMS OTS type.  <a href="#a48db68f8b63048019c35a756e58d9181">More...</a><br/></td></tr>
<tr class="separator:a48db68f8b63048019c35a756e58d9181"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a962337132813f098ed3a128cb4167b27"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XSecure_LmsOtsCoeff </td>
          <td>(</td>
          <td class="paramtype">u8 const *const&#160;</td>
          <td class="paramname"><em>Arr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>ArrayIndex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>w</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function extracts the digits from the array for bytes. </p>
<dl class="section note"><dt>Note</dt><dd>S (represented in bits) = 0x1234 [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0] ^ | coef(S, 7, 1)</dd></dl>
<p>[1, 2, 3, 4] ^ | coef(S, 0, 4)</p>
<p>If i is larger than the number of w-bit values in S, then coef(S, i, w) is undefined, this cant be checked here</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Array</td><td>- Byte array from where the digit needs to be picked </td></tr>
    <tr><td class="paramname">ArrayIndex</td><td>- When array is divided into array of digits, i represents the index of digit </td></tr>
    <tr><td class="paramname"></td><td>w - Width in bits, for each digit allowed values</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- digit value. </dd></dl>

<p>Referenced by <a class="el" href="xsecure__lms__ots_8h.html#ae4b1b7bba0abda9f7e5f7431cf2e07ce">XSecure_LmsOtsComputeChecksum()</a>.</p>

</div>
</div>
<a class="anchor" id="ae4b1b7bba0abda9f7e5f7431cf2e07ce"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_LmsOtsComputeChecksum </td>
          <td>(</td>
          <td class="paramtype">const u8 *const&#160;</td>
          <td class="paramname"><em>Array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>ArrayLen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>ls</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *const&#160;</td>
          <td class="paramname"><em>Checksum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function calculates the checksum for a given array. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Array</td><td>- Byte array ffor which checksum needs to be calculated </td></tr>
    <tr><td class="paramname">ArrayLen-</td><td>Length of input array </td></tr>
    <tr><td class="paramname">w</td><td>- Width in bits, for each digit allowed values </td></tr>
    <tr><td class="paramname">ls</td><td>- Number of bits to left-shift the calculated checksum </td></tr>
    <tr><td class="paramname">Checksum-</td><td>Pointer to address, where computed checksum needs to be copied</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS - Valid type is passed, and parameters are assigned</li>
<li>XST_FAILURE - If not a valid type is passed </li>
</ul>
</dd></dl>

<p>References <a class="el" href="group__xsecure__error__codes.html#ggacba8dc046b878afa42fdc63ce1dc2574a6d64080b375d7a684165177f5467469b">XSECURE_LMS_OTS_CHECKSUM_BUFF_INVALID_LEN_ERROR</a>, and <a class="el" href="xsecure__lms__ots_8c.html#a962337132813f098ed3a128cb4167b27">XSecure_LmsOtsCoeff()</a>.</p>

</div>
</div>
<a class="anchor" id="a48db68f8b63048019c35a756e58d9181"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_LmsOtsLookupParamSet </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="xsecure__lms__ots_8h.html#ac44fed4428b1bce22f588c3c913818fd">XSecure_LmsOtsType</a>&#160;</td>
          <td class="paramname"><em>Type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XSecure_LmsOtsParam **&#160;</td>
          <td class="paramname"><em>Parameters</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the parameters for the type of LMS OTS type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Type</td><td>XSecure_LmsOtsType, type of OTS algorithm selected </td></tr>
    <tr><td class="paramname">Parameters</td><td>Pointer to array location where all predefined parameter values are present XSecure_LmsOtsParam</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS - Valid type is passed, and parameters are assigned</li>
<li>XST_FAILURE - If not a valid type is passed </li>
</ul>
</dd></dl>
<p>lookup table for 'n', 'w', 'p', 'ls' &amp; Signature lengths</p>

<p>References <a class="el" href="xsecure__lms__ots_8h.html#a934fb8a4fb645f4419a0c10eceb4b883a0636fed8c37d4a35fce4dc7eb7e7d5aa">XSECURE_LMS_OTS_LS_NOT_SUPPORTED</a>, <a class="el" href="xsecure__lms__ots_8h.html#ac44fed4428b1bce22f588c3c913818fdab0be342315c7753f9987ad7d713b6fbd">XSECURE_LMS_OTS_NOT_SUPPORTED</a>, <a class="el" href="xsecure__lms__ots_8h.html#ac44fed4428b1bce22f588c3c913818fda6619d07dcdfb27f24037d94c2da75b7b">XSECURE_LMS_OTS_SHA256_N32_W4</a>, <a class="el" href="xsecure__lms__ots_8h.html#ac44fed4428b1bce22f588c3c913818fdaa2c7ed54a7b6a5dfe926d865e7d0e097">XSECURE_LMS_OTS_SHA256_N32_W8</a>, <a class="el" href="xsecure__lms__ots_8h.html#ac44fed4428b1bce22f588c3c913818fda350496cca3b0fceb91fa5611ab7080c3">XSECURE_LMS_OTS_SHAKE_N32_W2</a>, <a class="el" href="xsecure__lms__ots_8h.html#ac44fed4428b1bce22f588c3c913818fda52b24128174e65c3d46d6b6db0675b34">XSECURE_LMS_OTS_SHAKE_N32_W4</a>, <a class="el" href="xsecure__lms__ots_8h.html#ac44fed4428b1bce22f588c3c913818fdafd794b1bd3853e376d68972147b2e063">XSECURE_LMS_OTS_SHAKE_N32_W8</a>, <a class="el" href="group__xsecure__error__codes.html#ggacba8dc046b878afa42fdc63ce1dc2574a6ed7cfb9208ac3bc2fa03c7f076878e5">XSECURE_LMS_OTS_TYPE_LOOKUP_GLITCH_ERROR</a>, <a class="el" href="xsecure__lms__ots_8h.html#ac558edd4dd7643d17f2378f538378ce2">XSECURE_LMS_OTS_TYPE_MAX_SUPPORTED</a>, <a class="el" href="group__xsecure__error__codes.html#ggacba8dc046b878afa42fdc63ce1dc2574acc6b3fc14a0503e220be85b8c04f88a9">XSECURE_LMS_OTS_TYPE_UNSUPPORTED_ERROR</a>, <a class="el" href="xsecure__lms__ots_8h.html#a98e7ae28a938a2adda1c9d415f68a3cda88b2c964e9fb3bddfec0436b3f6f5e0c">XSECURE_LMS_OTS_W4</a>, <a class="el" href="xsecure__lms__ots_8h.html#a934fb8a4fb645f4419a0c10eceb4b883a4d6adf053e43c722afcd7dc7eafbfc12">XSECURE_LMS_OTS_W4_LS</a>, <a class="el" href="xsecure__lms__ots_8h.html#a54c7dfec9549d6617d8bcd3bf7b1f8bda2b630ba4210f383d7cc53575cca1637d">XSECURE_LMS_OTS_W4_P</a>, <a class="el" href="xsecure__lms__ots_8h.html#a797bf08fbeb731c200889e97c2024349a0387d324313898d9fa5db0bc0ddd4058">XSECURE_LMS_OTS_W4_U</a>, <a class="el" href="xsecure__lms__ots_8h.html#a48ca7b856b1c924469c32ed0b974b8d5aabbb56f1b23fcf58fa2270a9ce7b942f">XSECURE_LMS_OTS_W4_V</a>, <a class="el" href="xsecure__lms__ots_8h.html#a98e7ae28a938a2adda1c9d415f68a3cda507a403665f09b7704663ec47209f550">XSECURE_LMS_OTS_W8</a>, <a class="el" href="xsecure__lms__ots_8h.html#a934fb8a4fb645f4419a0c10eceb4b883a479e16a32a72d34466dcb570db3ebdba">XSECURE_LMS_OTS_W8_LS</a>, <a class="el" href="xsecure__lms__ots_8h.html#a54c7dfec9549d6617d8bcd3bf7b1f8bda8206e08695b310bd5b6769859e06179c">XSECURE_LMS_OTS_W8_P</a>, <a class="el" href="xsecure__lms__ots_8h.html#a797bf08fbeb731c200889e97c2024349a934a8457911f4003bf7c4584804cbe3e">XSECURE_LMS_OTS_W8_U</a>, <a class="el" href="xsecure__lms__ots_8h.html#a48ca7b856b1c924469c32ed0b974b8d5a8b42f1fc9faa06cbb2cf38aab405e238">XSECURE_LMS_OTS_W8_V</a>, <a class="el" href="group__xsecure__helper__server__apis.html#ga5738537e51cc4a10f5753b092955c4b0">XSECURE_SHA2_256_HASH_LEN</a>, <a class="el" href="group__xsecure__sha__example__apis.html#gad83e90d954ca31ac3d9cc687321cdb2d">XSECURE_SHAKE_256</a>, and <a class="el" href="group__xsecure__helper__server__apis.html#ga7af13060e1711b13d1d20bdbed3c20f5">XSECURE_SHAKE_256_HASH_LEN</a>.</p>

<p>Referenced by <a class="el" href="xsecure__lms__core_8h.html#a112da8c38a140d02852bd8f93ab78e2f">XSecure_HssFinish()</a>, <a class="el" href="xsecure__lms__core_8h.html#a981b22fbc50d9cd6f91c16604754f078">XSecure_HssInit()</a>, and <a class="el" href="xsecure__lms__core_8h.html#a6b50f9fb052dd231c50ea15138f17ff7">XSecure_LmsSignatureVerification()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
